﻿@model BenefitHelper.Sys.Groups
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<dl id="xiangmu">
    <dt>修改小组</dt>
</dl>
<div id="bigDataBox">
    @using (Html.BeginForm())
    {
        @Html.ValidationSummary(true)

        <input type="hidden" id="Id" name="Id" value="@Model.Id" />
        <input type="hidden" id="iid" name="iid" value="@ViewBag.iid" />
        <table cellspacing="0" cellpadding="0" class="list" style="width: 100%;">
            <tr>
                <td style="text-align: left; padding-left: 10px;" class="title">
                    @Html.LabelFor(model => model.GroupName)
                </td>
                <td style="text-align: left; padding-left: 10px;">
                    @Html.EditorFor(model => model.GroupName)
                    @Html.ValidationMessageFor(model => model.GroupName)
                </td>
            </tr>
            <tr>
                <td style="text-align: left; padding-left: 10px;" class="title">
                    @Html.LabelFor(model => model.ParentGroupId)
                </td>
                <td style="text-align: left; padding-left: 10px;">
                    <select name="ParentGroupId">
                        <option value="0">无父级小组</option>
                        @foreach (BenefitHelper.Sys.Groups group in ViewBag.groups)
                        {
                            if (group.Id == Model.ParentGroupId)
                            {
                            <option value="@group.Id" selected="selected">@group.GroupName</option>
                            }
                            else
                            {
                            <option value="@group.Id">@group.GroupName</option>
                            }
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <td style="text-align: left; padding-left: 10px;" class="title">
                    选定组长
                </td>
                <td style="text-align: left; padding-left: 10px;">
                    @foreach (BenefitHelper.Sys.Operator oper in ViewBag.operators)
                    {
                        bool operatorIsMaster = false;
                        foreach (BenefitHelper.Sys.GroupMaster gm in ViewBag.masters)
                        {
                            if (gm.GroupId == Model.Id && gm.MasterId == oper.Id)
                            {
                                operatorIsMaster = true;
                                break;
                            }
                        }
                        if (operatorIsMaster)
                        {
                        <input type="checkbox" name="master" value="@oper.Id" checked="checked" /> @oper.UName
                        }
                        else
                        {
                        <input type="checkbox" name="master" value="@oper.Id" /> @oper.UName
                        }
                    }
                </td>
            </tr>
        </table>
        <div style="height: 10px; line-height: 10px;">
        </div>
        <div style="text-align: right; padding-right: 30px;">
            <input type="submit" class="button1" value="保存" />&nbsp;&nbsp;&nbsp;&nbsp;<input
                type="button" class="button1" value="返回" onclick="javascript:history.go(-1)" />
        </div>
  
    }
    <div class="report-tip">
        <div class="report-tip-text">
            <div>
                <b>功能说明：</b></div>
            <div>
                组是一个抽象的概念，我们可以把一个部门当成是一个组，也可以把一个技术小组认为是一个组。<br />
                一个组可以有多个组长，组长可以查看组员的详细交易信息，组长只可以看自己小组的组员的交易情况。<br />
                父级小组在组设定时需要手动进行设定，方便我们统计几个组的综合数据。<br />
                创建完组以后还可以手动修改组的信息，请放心操作。</div>
        </div>
        <div class="report-tip-close">
            &nbsp;</div>
    </div>
</div>
